﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data;
using System.Collections.ObjectModel;

namespace Szakdolgozat.Screens
{
    /// <summary>
    /// Interaction logic for DatabaseView.xaml
    /// </summary>
    public partial class DatabaseView : UserControl
    {
        MainWindow mainWindow;
        Controller controller = new Controller();
        public ObservableCollection<Controller.Data> List { get; set; }
        object selected = new Controller.Data();

        public DatabaseView(MainWindow mainwindow, ObservableCollection<Controller.Data> List_in)
        {

            this.List = List_in;
            mainWindow = mainwindow;
            InitializeComponent();
        }

        private void backmeasurebutton_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.contentControl1.Content = new MeasureView(mainWindow);
        }

        private void lvUsers_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Controller.Data lbi = new Controller.Data();
            lbi = (Controller.Data)(sender as ListBox).SelectedItem;
            controller.GetResults(lbi.Measure_id);
        }

        private void mainmenubutton_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.contentControl1.Content = new MainMenuView(mainWindow);
        }

    }
}
